This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2000-196863, filed Jun. 29, 2000, the entire contents of which are incorporated herein by reference.
The present invention relates to a disk controller incorporated in a disk storage system that has a CPU for controlling execution of a command supplied from a host system, and more particularly to a controller having a function of detecting a hang-up state of the disk storage system when this state occurs while the command from the host system is executed.
A magnetic disk drive is known as a typical disk storage system using a disk storage medium as a medium for storing data. In general, the magnetic disk drive is for use in a host system such as a personal computer. The magnetic disk drive is connected to the host system via a predetermined interface (host interface).
A command from the host system to the magnetic disk drive is supplied thereto via the host interface. A command from the host system to the magnetic disk drive includes a read command, a write command, a self-test command, etc. The self-test command is used for instructing the magnetic disk drive to test itself.
Upon receiving a command from the host system, the magnetic disk drive starts execution of the command. However, there is a case where the magnetic disk drive freezes for some reason before the execution of the command finishes, i.e. it hangs up. It is considered that this state occurs, for example, because the host system and the magnetic disk drive use different protocols. However, the conventional magnetic disk drives have the problem that even when they hang up, they cannot recognize their hang-up state and hence cannot do any processing. This problem also occurs in disk storage systems, other than the magnetic disk drive, such as a floppy disk drive, a CD-ROM drive, a magneto-optical disk drive, etc.
The present invention has been developed in light of the above-described situation, and aims to overcome a hang-up state, when it occurs for some reason in a disk storage system having a CPU for controlling execution of a command, by causing a disk controller incorporated in the system to detect the hang-up state and generate an interrupt to the CPU.
To attain the aim, a disk controller according to the invention is provided in the disk storage system. In this disk storage system, a command supplied from a host system is executed under the control of the CPU. The disk controller includes a detector for detecting a hang-up state of the disk storage system when the hang-up state occurs as a result of execution of a command in the disk storage system, and an interrupt generator for generating an interrupt to the CPU when the detector has detected the hang-up state.
In the disk controller, the detector detects hang-up when it occurs in the disk storage system. To detect hang-up, it is sufficient if a command execution period is monitored. When the detector has detected a hang-up state of the disk storage system, the interrupt generator generates an interrupt to the CPU. Upon receiving the interrupt, the CPU starts control for eliminating the hang-up state. To enable the CPU to execute this control, it is preferable to provide the CPU with means responsive to the interrupt for starting control for re-executing a command having been executed when hang-up occurred. It is also preferable to invalidate the ready-bit of a status register. In this case, the not-ready state indicated by the invalidation of the ready-bit is reported to the host system. This is equivalent to informing the host system that the disk storage system reaches a hang-up state and cannot completely execute a command. As a result, the host system can execute processing for eliminating the hang-up state of the disk storage system.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.